﻿@{
    ViewBag.Title = "Documents";
}



@{IEnumerable<string> enumerateFiles = Directory.EnumerateFiles(Server.MapPath("~/Content/Documents"));}
@{
    if (Request.IsAuthenticated)
    {
        <h3>Authenticated User</h3>

<ul>
    @foreach (var fullPath in enumerateFiles)
    {

        var fileName = Path.GetFileName(fullPath);
        
             <li> <a href="../../Content/Documents/@fileName"> @fileName</a></li>
    }
</ul>
    }
    else
    {
         <h3>Non-Authenticate User, register and/or login to see documents</h3>
    }
    
    if(User.Identity.Name == "Omid")
    {
        <h3><span style="font-size: larger">Administrator Controls</span> <br/>
    <ul>
   <li> @Html.ActionLink("Add an Employee ID", "AddEmployeeId", "Home", null, new { style = "text-decoration: none" })</li>
   <li> @Html.ActionLink("Remove an Employee ID and User", "RemoveEmployee", "Home", null, new { style = "text-decoration: none" })</li>
     
   <li><span style="color: blue">Upload file to the Documents</span></li> 
    @using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
    <input type="file" name="file" /><br/>
    <input type="submit" value="OK" />
    }
    </ul>
     </h3>
    }
}




